﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MeetingInfo.aspx.cs" Inherits="Meeting.Web.Admin.MeetingSet.MeetingInfo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>会议信息</title>
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
    <script src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../Scripts/common.js" type="text/javascript"></script>
    <link href="../../Css/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        //会议基本信息保存
        $(function () {

            //会议室
            $("#RoomId").combobox({
                url: 'MeetingOperation.ashx?method=GetRoom',
                valueField: 'Id',
                textField: 'Name'
            })
            //视频会议室 VideoRoomId
            $("#VideoRoomId").combobox({
                url: 'MeetingOperation.ashx?method=GetVideoRoom',
                valueField: 'Id',
                textField: 'Name'
            })
            //获取会议ID
            var meetingID = request("Id");
            var categoryId = "";
            $.post("MeetingEditOperation.ashx?method=GetMeetingById", { Id: meetingID }, function (data) {
                if (data.success == true) {
                    data = data.ResponseData[0];
                    $("#Id").val(data.Id);
                    $("#CategoryId").combobox("setValue", data.CategoryId);
                    $("#CategoryId").combobox("setText", data.CategoryName);
                    //$("#CategoryId").combobox("disable");
                    $("#Name").val(data.Name);

                    //
                    $("#StartDate").val(data.StartDate);
                    $("#EndDate").val(data.EndDate);
                    $("#RoomId").combobox("setValue", data.RoomId);
                    $("#RoomId").combobox("setText", data.RoomName); 
                    //
                    $("#VideoRoomId").combobox("setValue", data.VideoRoomId);
                    $("#VideoRoomId").combobox("setText", data.VideoRoomName); 

                    $("#Duration").val(data.Duration);
                    $("#Status").combobox('setValue', data.Status);


                } else {

                    $("#error").val(data.Message); $.messager.alert("提示", data.Message);
                }
            });
        });

        //第一步 保存会议信息        
        function MeetingInfoAdd() {
            //验证表单
            if ($("#form1").form('validate') == false) {
                return;
            }
            var Id = $("#Id").val();
            var CategoryId = $("#CategoryId").combobox('getValue');
            var Name = $("#Name").val();
            //
            var StartDate = $("#StartDate").val();
            var EndDate = $("#EndDate").val();
            if (StartDate == "" || EndDate == "") {
                $.messager.alert("提示", "请选择会议时间");
                return;
            }
            var RoomId = $("#RoomId").combobox('getValue');
            var VideoRoomId = $("#VideoRoomId").combobox('getValue');
            var Duration = $("#Duration").val();
            var Status = $("#Status").combobox('getValue');
            //
            var postData = { Id: Id, CategoryId: CategoryId, Name: Name, StartDate: StartDate, EndDate: EndDate, VideoRoomId: VideoRoomId,
                RoomId: RoomId, Duration: Duration, Status: Status
            };
            //提交

            $.post("MeetingOperation.ashx?method=MeetingInfoAdd", postData, function (data) {
                if (data.success == true) {
                    $.messager.alert("提示", "保存成功");
                    //保存成功，退出当前对话框
                    art.dialog.close();
                } else {

                    $.messager.alert("提示", data.Message);
                }
            });
        } 
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="showView1" cellpadding="1" cellspacing="1" align="center">
            <tr>
                <td class="title">
                    <span style="color: Red;">*</span> 会议类型:
                </td>
                <td class="td_Modify1">
                    <select id="CategoryId" class="easyui-combobox" editable="false" style="width: 403px;">
                        <option value="1">党组会议</option>
                        <option value="2">办公会议</option>
                        <option value="3">一般会议</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="title">
                    <span style="color: Red;">*</span> 会议名称:
                </td>
                <td class="td_Modify1">
                    <input type="hidden" id="Id" /><!--会议ID-->
                    <input id="Name" name="Name" type="text" class="easyui-validatebox" required="true"
                        style="width: 400px" />
                </td>
            </tr>
            <tr style="display: none;">
                <td class="title">
                    <span style="color: Red;">*</span>会议主持人:
                </td>
                <td class="td_Modify1">
                    <input type="hidden" id="HostId" />
                    <input id="Host" type="text" class="easyui-validatebox" readonly="readonly" style="width: 400px" /><img
                        src="../../Images/Search.ico" onclick="GetMeetingHost();" alt="选择会议主持人" id="SelectHostId" />
                </td>
            </tr>
            <tr>
                <td class="title">
                    <span style="color: Red;">*</span>开始时间:
                </td>
                <td class="td_Modify1">
                    <input id="StartDate" onfocus="WdatePicker({startDate:'%y-%M-01 00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"
                        style="width: 400px" />
                </td>
            </tr>
            <tr>
                <td class="title">
                    <span style="color: Red;">*</span> 预计结束时间:
                </td>
                <td class="td_Modify1">
                    <input id="EndDate" onfocus="WdatePicker({startDate:'%y-%M-01 00:00',dateFmt:'yyyy-MM-dd HH:mm',alwaysUseStartDate:true})"
                        style="width: 400px" />
                    <%--<a id="A1" class="easyui-linkbutton" onclick="">计算</a>--%>
                </td>
            </tr>
            <tr style="display: none;">
                <td class="title">
                    持续时间:
                </td>
                <td class="td_Modify1">
                    <input id="Duration" name="peoplecount" value="1" class="easyui-numberspinner" precision="1"
                        style="width: 403px" />
                </td>
            </tr>
            <tr>
                <td class="title">
                    <span style="color: Red;">*</span>会议室:
                </td>
                <td class="td_Modify1">
                    <input id="RoomId" class="easyui-combobox" required="true" style="width: 403px; line-height: 25px;" />
                </td>
            </tr>
            <tr>
                <td class="title">
                    <span style="color: Red;">*</span>视频会议室:
                </td>
                <td class="td_Modify1">
                    <input id="VideoRoomId" class="easyui-combobox" required="true" style="width: 403px;
                        line-height: 25px;">
                </td>
            </tr>
            <tr>
                <td class="title">
                    会议状态:
                </td>
                <td class="td_Modify1">
                    <select id="Status" class="easyui-combobox" style="width: 403px;">
                        <option value="1">准备</option>
                        <option value="2">激活</option>
                        <option value="3">取消</option>
                        <option value="4">关闭</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="title">
                    &nbsp;
                </td>
                <td class="td_Modify1">
                    <a id="MeetingSave" class="easyui-linkbutton" onclick="MeetingInfoAdd();">保存</a>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
